package com.zhang.remoteapi.feign;

import com.zhang.common.core.constant.SecurityConstant;
import com.zhang.common.core.po.admin.SysLog;
import com.zhang.common.core.vo.Result;
import com.zhang.common.core.dto.UserInfo;
import com.zhang.remoteapi.feign.fallbackfactory.AdminServiceFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "admin",fallbackFactory = AdminServiceFeignFallbackFactory.class)
public interface AdminServiceFeign {

    @GetMapping("/user/info/{username}")
    public Result<UserInfo> findByUsername(@PathVariable(value = "username")String username, @RequestHeader(SecurityConstant.FROM) String from);

    @PostMapping("/log")
    public Result<String> saveSysLog(@RequestBody SysLog sysLog);
}
